package com.shuangyulin.domain;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;


public class ExcelFile extends ConfigFile {
	public static String fileToBeRead = "D:\\test1.xls";
	
	ExcelFile(String filePath, String filename){
		
	}
	

	public int readCfgFile(){
		int i = 0;
		int j = 0;
		
	    try {
			HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileToBeRead));
			
			
			HSSFSheet sheet = workbook.getSheet("Sheet1");
			
			HSSFRow row = sheet.getRow(0);
			HSSFCell cell = row.getCell(0);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	    
	    return 0;
	}
	
	public int writeCfgFile(){
		return 0;
	}
}
